package com.rachel.activitytest.video;

import android.content.Context;
import android.content.res.Configuration;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ListView;

/**
 * Created by zhengshaorui on 2017/8/28.
 */

public class CusTomListView extends ListView {
    private static final String TAG = "moon";
    public CusTomListView(Context context) {
        super(context);
    }

    public CusTomListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CusTomListView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }



    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        int orientation = getResources().getConfiguration().orientation;
        if (ev.getAction() == MotionEvent.ACTION_MOVE) {
            if (orientation == Configuration.ORIENTATION_LANDSCAPE) {

                return true;
            }
        }

        return super.dispatchTouchEvent(ev);
    }
}
